/*
    equals : 区分大小写
    equalsIgnoreCase : 用于忽略大小写的验证码
*/
import java.util.Scanner;

public class CustomerSignIn {
    public static void main(String[] args) {
        int chance = 3;
        String username = "Alex";
        String password = "LKo2489247Ylo";

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名和密码:");
        for (int i = 0; i < chance; i++) {
            String s1 = sc.nextLine();
            String s2 = sc.nextLine();
            if ((s1.equals(username))&&(s2.equals(password))){
                System.out.println("登陆成功!");
                break;
            }else {
                if (i == chance-1){
                    System.out.println("三次机会结束!");
                }else System.out.println("请重新输入!您还剩余"+(chance-i-1)+"次机会");
            }

        }
    }
}
